﻿@model CoreData.Merchant
@{ 
    ViewBag.Title = "Update Merchant";
}
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
                Details</h1>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid tabs">
            <ul>
                <li><a href="#tabs-1">Content</a></li>
               <li><a href="#tabs-2">Specials</a></li>
               <li><a href="#tabs-3">Orders list</a></li>
               <li><a href="#tabs-4">Payment transaction</a></li>
            </ul>
            @using (Ajax.BeginForm("AddOrUpdate", "MerchantManagement", new AjaxOptions { OnSuccess = "Success", HttpMethod = "Post" }, new { enctype = "multipart/form-data", @id = "validation" }))
            {
                <div class="warning-area">
                </div>
                <div id="tabs-1">
                    @Html.HiddenFor(x => x.ID)
                    @* @Html.HiddenFor(x => x.UserID)*@
                    <div class="row-form">
                        <div class="span2">
                            Merchant name:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.MerchantName, new { @class = "validate[required]" })</div>
                        <div class="clear">
                        </div>
                    </div>

                    <div class="row-form">
                        <div class="span2">
                            Logo :</div>
                        <div class="span8">
                            <input id="fileupload" type="file" name="file" />
                            @if (Model != null && Model.Logo != null && Model.Logo != "")
                            {
                                <div id="image">
                                    <img src="@Url.Content("~/Media/Merchant/" + Model.Logo)" width="70px" height="70px" alt="@Model.Logo" />
                                </div>
                          
                            }
                            else
                            {
                                <div id="image">
                                </div>
                            }
                        </div>
                        <div class="clear">
                        </div>
                    </div>

                    <div class="row-form">
                        <div class="span2">
                           User Name:</div>
                        <div class="span9">
                           @Html.DropDownListFor(x => x.UserID, Model.ListAccountExt, new Dictionary<string, object> { { "data-placeholder", "Choose a account" }, { "class", "chosen-select" }, { "style", "width:200px;" } })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                           Balance:</div>
                        <div class="span9">
                              @Html.TextBoxFor(x => x.Balance, new { @class = "validate[required,custom[integer]]", @style = "width:200px" }) USD</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Register date:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.RegisterDate)</div>
                        <div class="clear">
                        </div>
                    </div>
                     <div class="row-form">
                        <div class="span2">
                            Active date:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.ActiveDate)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                           Plan:</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.PlanID, Model.ListPlanExt)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                           Status:</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.Status, Model.ListMerchantStatusExt)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Note</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.Note, new { @cols = "10", @rows = "10" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    
                    <div class="row-form">
                        <div class="span2">
                            Published :</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.Active)</div>
                        <div class="clear">
                        </div>
                    </div>

                    <div class="row-form">
                        <div class="span2">
                            Meta Title :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaTitle)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Keyword :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaKeyword)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Description :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaDescription)</div>
                        <div class="clear">
                        </div>
                    </div>

                     @if (Helper.SessionManagement.Value("pvalue").Contains("C") || Helper.SessionManagement.Value("pvalue").Contains("U"))
                            {
                <div class="row-form">
                    <div class="span2">
                    </div>
                    <div class="span9">
                        <input type="submit" class="btn btn-info span3" value="Update" /></div>
                    <div class="clear">
                    </div>
                </div>
                            }
                </div>
            
               
                            
              <div id="tabs-2">
               <div class="clear">
              </div>
                 <div class="block-fluid table-sorting">
                     <div class="row-fluid listproduct">
                       @if (Helper.SessionManagement.Value("pvalue").Contains("R"))
                       {
                          @Html.Action("_ShowAll", "ProductManagement", new { search = "Merchant.ID=" + Model.ID })
                       }
                       else
                       { 
                           <span>Not permission</span>
                       }
                   </div>
                 </div>

              </div>
                
                
              <div id="tabs-3">
               <div class="clear">
              </div>
                 <div class="block-fluid table-sorting">
                     <div class="row-fluid listproduct">
                       @if (Helper.SessionManagement.Value("pvalue").Contains("R"))
                       {
                          @Html.Action("_ShowAllForMerchant", "OrderManagement", new { MerchantID = Model.ID })
                       }
                       else
                       { 
                           <span>Not permission</span>
                       }
                   </div>
                 </div>

              </div>
                
                
                <div id="tabs-4">
               <div class="clear">
              </div>
                 <div class="block-fluid table-sorting">
                     <div class="row-fluid listproduct">
                       @if (Helper.SessionManagement.Value("pvalue").Contains("R"))
                       {
                          @Html.Action("_ShowAll", "MerchantPaymentManagement", new { search =" MerchantID="+ Model.ID })
                       }
                       else
                       { 
                           <span>Not permission</span>
                       }
                   </div>
                 </div>

              </div>
                
            }
        </div>
    </div>
</div>
